package utils.datastructureZ.binaryTree;

public class RBNode<ElementType extends Comparable<ElementType>> {

    public enum NodeColor {BLACK, RED};

    ElementType data;
    RBNode<ElementType> left;
    RBNode<ElementType> right;
    RBNode<ElementType> parent;
    NodeColor color;

    //for count rank
    long lNumber;
    long rNumber;

    public RBNode(
        ElementType data,
        RBNode<ElementType> left,
        RBNode<ElementType> right,
        RBNode<ElementType> parent,
        NodeColor color,
        long lNumber,
        long rNumber
    ) {
        this.data    = data;
        this.left    = left;
        this.right   = right;
        this.parent  = parent;
        this.color   = color;
        this.lNumber = lNumber;
        this.rNumber = rNumber;
    }

    public RBNode(ElementType data) {
        this(data, null, null, null, NodeColor.BLACK, 0L, 0L);
    }
}
